<!DOCTYPE html>
<html>

<head>
    <#include "/pxlm/admin/components/meta.html" />
    <title>蓁奕科技 ${metaTitleSuffix!}</title>
    <#include "/pxlm/admin/components/stylesheets.html" />
    <style>
        .avatar-uploader .el-upload {
        border: 1px dashed #d9d9d9;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        overflow: hidden;
    }
    .avatar-uploader .el-upload:hover {
        border-color: #409EFF;
    }
    .avatar-uploader-icon {
        font-size: 28px;
        color: #8c939d;
        width: 178px;
        height: 178px;
        line-height: 178px;
        text-align: center;
    }
    .avatar {
        width: 178px;
        height: 178px;
        display: block;
    }
    .el-tag+.el-tag {
        margin-left: 10px;
    }

    .button-new-tag {
        margin-left: 10px;
        height: 32px;
        line-height: 30px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .input-new-tag {
        width: 90px;
        margin-left: 10px;
        vertical-align: bottom;
    }

    .field-options {
        margin-top: 10px;
        padding: 5px 10px;
        border-radius: 4px;
        border: 1px solid #dcdfe6;
    }
    </style>
</head>

<body>
    <div id='app'>
        <el-container>
            <#assign menuIndex="1-2" />
            <#include "/pxlm/admin/components/menu.html" />
            <el-container>
                <#include "/pxlm/admin/components/header.html" />
                <el-main>
                    <template>
                        <el-form ref="form" :model="form" label-width="120px">
                            <el-row>
                                <el-form-item label="学校">
                                    <el-select v-model="form.schoolId" placeholder="请选择">
                                        <el-option v-for="item in schools" :key="item.id" :label="item.name" :value="item.id">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-row>
                            <el-row>
                                <el-form-item label="标题">
                                    <el-input v-model="form.title"></el-input>
                                </el-form-item>
                            </el-row>
                            <el-row>
                                <el-form-item label="优先级">
                                    <el-input v-model="form.sort" type='number'></el-input>
                                </el-form-item>
                            </el-row>
                            <el-row>
                                <el-form-item>
                                    <el-button type="primary" @click="onSubmit">保存</el-button>
                                </el-form-item>
                            </el-row>
                        </el-form>
                    </template>
                </el-main>
            </el-container>
        </el-container>
        <#include "/pxlm/admin/components/footer.html" />
    </div>
    <#include "/pxlm/admin/components/scripts.html" />
    <#include "/components/qiniu.html" />
    <script type="text/javascript">
    var vue = new Vue({
        el: '#app',
        data() {
            return {
                form: {
                },
                schools: [{ id: 4, name: '品学联萌总部'}]
            }
        },
        mounted: function() {
            if ('${data!}') {
                this.form = toJson(`${data!'{}'}`);
            }
        },
        methods: {
            onSubmit() {
                var param = {
                    categoryId: this.form.id,
                    schoolId: this.form.schoolId,
                    title: this.form.title,
                    sort: this.form.sort
                }
                // console.log(param)
                var url = ''
                var ref = '${referer!""}'
                var url = '/pxlm/admin/product/updateCategory'
                axiosRequest(param, url, ref)
            }
        }
    })
    </script>
    <script>
    // vue.tableData = ${items!};
    </script>
</body>

</html>